/* 全局样式 - 玻璃态设计 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 白色系玻璃态主题变量 */
    --bg-primary: rgba(255, 255, 255, 0.8);
    --bg-secondary: rgba(255, 255, 255, 0.6);
    --bg-tertiary: rgba(255, 255, 255, 0.4);
    --bg-glass: rgba(255, 255, 255, 0.3);
    --bg-glass-hover: rgba(255, 255, 255, 0.5);
    --text-primary: rgba(60, 60, 60, 0.95);
    --text-secondary: rgba(100, 100, 100, 0.8);
    --border-glass: rgba(255, 255, 255, 0.4);
    --accent-color: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-blur: blur(10px);
    --button-size: 48px;
    --button-gap: 12px;
}

[data-theme="dark"] {
    /* 暗色玻璃态 */
    --bg-primary: rgba(0, 0, 0, 0.1);
    --bg-secondary: rgba(0, 0, 0, 0.15);
    --bg-tertiary: rgba(0, 0, 0, 0.2);
    --bg-glass: rgba(0, 0, 0, 0.5);  /* 降低透明度，提高不透明度 */
    --bg-glass-hover: rgba(0, 0, 0, 0.6);
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --border-glass: rgba(255, 255, 255, 0.1);
    --accent-color: #00d4ff;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="tech"] {
    /* 黑灰科技感主题 - 基于 #191919 */
    --bg-primary: rgba(25, 25, 25, 0.1);        /* #191919 透明版 */
    --bg-secondary: rgba(35, 35, 35, 0.2);      /* #232323 透明版 */
    --bg-tertiary: rgba(45, 45, 45, 0.3);       /* #2d2d2d 透明版 */
    --bg-glass: rgba(25, 25, 25, 0.6);          /* #191919 半透明 */
    --bg-glass-hover: rgba(35, 35, 35, 0.7);    /* #232323 半透明 */
    --bg-solid: #191919;                        /* 主背景色 */
    --bg-solid-light: #232323;                  /* 浅一度 */
    --bg-solid-lighter: #2d2d2d;                /* 更浅 */
    --bg-solid-dark: #0f0f0f;                   /* 深一度 */
    --text-primary: rgba(240, 240, 240, 0.95);
    --text-secondary: rgba(160, 160, 160, 0.8);
    --border-glass: rgba(100, 100, 100, 0.3);
    --accent-color: #00d4ff;
    --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #0099cc 50%, #006699 100%);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glass-blur: blur(8px);
    
    /* 科技感特效 */
    --tech-glow: 0 0 20px rgba(0, 212, 255, 0.3);
    --tech-border: rgba(0, 212, 255, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.5s ease;
    overflow-x: hidden;
    background-attachment: fixed;
}

/* 默认/白色系玻璃态主题背景 */
body:not([data-theme]) {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%, #f8fafc 100%);
}

body[data-theme="light"] {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%, #f8fafc 100%);
}

body[data-theme="dark"] {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
}

body[data-theme="tech"] {
    background: linear-gradient(135deg, #0f0f0f 0%, #191919 25%, #232323 50%, #191919 75%, #0f0f0f 100%);
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 - 玻璃态 */
.app-header {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-bottom: 2px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--glass-shadow);
    position: relative;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 白色系主题特殊效果 */
body:not([data-theme]) .app-header,
[data-theme="light"] .app-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

body:not([data-theme]) .input-section,
[data-theme="light"] .input-section {
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-selector {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
    min-width: 120px;
}

.theme-selector:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(31, 38, 135, 0.4);
}

.theme-selector:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2), var(--glass-shadow);
}

[data-theme="tech"] .theme-selector {
    background: var(--bg-solid-light);
    border-color: var(--border-glass);
    box-shadow: var(--glass-shadow);
}

[data-theme="tech"] .theme-selector:hover {
    background: var(--bg-solid-lighter);
    box-shadow: var(--glass-shadow);
    border-color: var(--accent-color);
}

[data-theme="tech"] .theme-selector:focus {
    background: var(--bg-solid-lighter);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.3), var(--glass-shadow);
}

/* 主要内容区域 - 全屏可视化 */
.main-content {
    flex: 1;
    display: flex;
    gap: 0;
    padding: 0;
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

/* 悬浮输入面板 */
.floating-input-panel {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 380px;
    max-width: calc(100vw - 2rem);
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--glass-shadow);
    z-index: 20;
    transition: all 0.3s ease;
    max-height: calc(100vh - 100px);
    overflow: hidden; /* 确保内容不会溢出导致滚动条 */
}

.floating-input-panel .input-content {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.floating-input-panel .input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.floating-input-panel .input-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0.9;
    margin: 0;
    flex: 1;
}

.panel-toggle-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    background: var(--bg-glass);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.panel-toggle-btn:hover {
    background: var(--bg-glass-hover);
    transform: scale(1.1);
}

.input-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

/* 收起状态 */
.floating-input-panel.collapsed .input-content {
    display: none;
}

.floating-input-panel.collapsed {
    width: auto;
    min-width: 140px;
}

.floating-input-panel.collapsed .panel-toggle-btn {
    transform: rotate(180deg);
}



/* 格式选择和显示区域 */
.format-display-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    align-items: center;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.format-selector-container {
    flex: 1.2;
    max-width: 40%;
}

.format-selector {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    background: var(--bg-secondary);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
    padding-right: 2rem;
}

.format-selector:hover {
    background: var(--bg-glass-hover);
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(31, 38, 135, 0.4);
}

.format-selector:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2), var(--glass-shadow);
}

.format-display-container {
    flex: 1.8;
    display: flex;
    align-items: center;
}

.format-display-wrapper {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
}

.format-display {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    background: var(--bg-tertiary);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
    cursor: default;
    opacity: 0.9;
}

.format-display:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2), var(--glass-shadow);
}

.copy-btn-inner {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.copy-btn-inner:hover {
    background: var(--bg-glass-hover);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.copy-btn-inner:active {
    transform: translateY(-50%) scale(1.05);
}

.copy-icon {
    font-size: 0.7rem;
    line-height: 1;
}

/* 快速操作区域 */
.quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    animation: fadeInUp 0.6s ease-out;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
    white-space: nowrap;
    flex-shrink: 0;
}

.action-btn:hover:not(:disabled) {
    background: var(--bg-glass-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(31, 38, 135, 0.4);
    border-color: var(--accent-color);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.action-btn span:first-child {
    font-size: 0.8rem;
    line-height: 1;
}

/* 白色系主题样式 */
body:not([data-theme]) .format-selector,
[data-theme="light"] .format-selector {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body:not([data-theme]) .format-selector:hover,
[data-theme="light"] .format-selector:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

body:not([data-theme]) .format-display,
[data-theme="light"] .format-display {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body:not([data-theme]) .copy-btn-inner,
[data-theme="light"] .copy-btn-inner {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body:not([data-theme]) .copy-btn-inner:hover,
[data-theme="light"] .copy-btn-inner:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

body:not([data-theme]) .action-btn,
[data-theme="light"] .action-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body:not([data-theme]) .action-btn:hover:not(:disabled),
[data-theme="light"] .action-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

/* 科技主题样式 */
[data-theme="tech"] .format-selector {
    background: var(--bg-solid-light);
    border-color: var(--border-glass);
    box-shadow: var(--glass-shadow);
}

[data-theme="tech"] .format-selector:hover {
    background: var(--bg-solid-lighter);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4), var(--glass-shadow);
}

[data-theme="tech"] .format-display {
    background: var(--bg-solid);
    border-color: var(--border-glass);
    box-shadow: var(--glass-shadow);
}

[data-theme="tech"] .copy-btn-inner {
    background: var(--bg-solid-light);
    box-shadow: var(--glass-shadow);
}

[data-theme="tech"] .copy-btn-inner:hover {
    background: var(--bg-solid-lighter);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4), var(--glass-shadow);
}

[data-theme="tech"] .action-btn {
    background: var(--bg-solid-light);
    border-color: var(--border-glass);
    box-shadow: var(--glass-shadow);
}

[data-theme="tech"] .action-btn:hover:not(:disabled) {
    background: var(--bg-solid-lighter);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4), var(--glass-shadow);
}

.input-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 格式状态指示器 */
.format-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
    animation: fadeInUp 0.7s ease-out;
}

.format-indicator.detected {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--accent-color);
}

.format-indicator.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
}

[data-theme="dark"] .format-indicator.error,
[data-theme="tech"] .format-indicator.error {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ff6b6b;
}

.indicator-icon {
    font-size: 0.8rem;
    line-height: 1;
}

.indicator-text {
    font-weight: 500;
}

/* 白色系主题格式指示器 */
body:not([data-theme]) .format-indicator,
[data-theme="light"] .format-indicator {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body:not([data-theme]) .format-indicator.detected,
[data-theme="light"] .format-indicator.detected {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--accent-color);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.15);
}

/* 科技主题格式指示器 */
[data-theme="tech"] .format-indicator {
    background: var(--bg-solid-light);
    border-color: var(--border-glass);
    box-shadow: var(--glass-shadow);
}

[data-theme="tech"] .format-indicator.detected {
    background: var(--bg-solid-lighter);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3), var(--glass-shadow);
    color: var(--text-primary);
}

.file-upload-area {
    border: 2px dashed var(--border-glass);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: var(--bg-secondary);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

[data-theme="tech"] .file-upload-area {
    background: var(--bg-solid-light);
    border-color: var(--border-glass);
    box-shadow: var(--glass-shadow);
}

[data-theme="tech"] .file-upload-area:hover {
    background: var(--bg-solid-lighter);
    border-color: var(--accent-color);
    box-shadow: var(--glass-shadow);
}

.file-upload-area:hover {
    border-color: var(--accent-color);
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
    box-shadow: var(--glass-shadow);
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-area p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0;
}

#explainInput {
    flex: 1;
    min-height: 280px;
    padding: 0.75rem;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    background: var(--bg-secondary);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    resize: vertical;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
}

#explainInput:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--bg-glass-hover);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2), var(--glass-shadow);
}

/* 白色系主题输入框效果 */
body:not([data-theme]) #explainInput,
[data-theme="light"] #explainInput {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    color: rgba(60, 60, 60, 0.95);
}

body:not([data-theme]) #explainInput:focus,
[data-theme="light"] #explainInput:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="tech"] #explainInput {
    border-color: var(--border-glass);
    box-shadow: var(--glass-shadow);
    font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: var(--bg-solid);
    color: var(--text-primary);
    /* 移除可能导致滚动条的输入框动画 */
}

[data-theme="tech"] #explainInput:focus {
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3), var(--glass-shadow);
    border-color: var(--accent-color);
}

/* 移除导致滚动条的输入框浮动动画 */

.parse-btn {
    background: var(--accent-gradient);
    color: white;
    border: 1px solid var(--border-glass);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    position: relative;
    overflow: hidden;
}

.parse-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.parse-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 白色系主题按钮效果 */
body:not([data-theme]) .parse-btn,
[data-theme="light"] .parse-btn {
    background: var(--accent-gradient);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: white;
}

body:not([data-theme]) .parse-btn:hover,
[data-theme="light"] .parse-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.3);
}

[data-theme="tech"] .parse-btn {
    border-color: var(--border-glass);
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
    /* 移除可能导致滚动条的按钮动画 */
}

[data-theme="tech"] .parse-btn:hover {
    box-shadow: var(--glass-shadow);
    transform: translateY(-2px);
}

[data-theme="tech"] .parse-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

[data-theme="tech"] .parse-btn:hover::before {
    left: 100%;
}

/* 可视化区域 - 全屏背景画布 */
.visualization-section {
    flex: 1;
    width: 100%;
    height: calc(100vh - 70px);
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* 隐藏原有头部，使用悬浮按钮 */
.visualization-header {
    display: none;
}

/* 悬浮按钮组 - 统一规范 */
.floating-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: var(--button-gap);
    z-index: 50;
}

.floating-btn {
    width: var(--button-size);
    height: var(--button-size);
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
}

.floating-btn:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.5);
    border-color: var(--accent-color);
}

.floating-btn:active {
    transform: translateY(-1px) scale(1.05);
}

/* 悬浮按钮工具提示 */
.floating-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 0.75rem);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
    z-index: 100;
    pointer-events: none;
}

.floating-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 白色系主题悬浮按钮效果 */
body:not([data-theme]) .floating-btn,
[data-theme="light"] .floating-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    color: rgba(60, 60, 60, 0.9);
}

body:not([data-theme]) .floating-btn:hover,
[data-theme="light"] .floating-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--accent-color);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.2);
    color: var(--accent-color);
}

body:not([data-theme]) .floating-btn::after,
[data-theme="light"] .floating-btn::after {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: rgba(60, 60, 60, 0.9);
}

[data-theme="tech"] .floating-btn {
    border-color: var(--border-glass);
    box-shadow: var(--glass-shadow);
    background: var(--bg-solid-light);
}

[data-theme="tech"] .floating-btn:hover {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4), var(--glass-shadow);
    border-color: var(--accent-color);
    background: var(--bg-solid-lighter);
    animation-play-state: paused;
    transform: translateY(-3px) scale(1.1);
}

[data-theme="tech"] .floating-btn::after {
    background: var(--bg-solid-light);
    border-color: var(--border-glass);
    box-shadow: var(--glass-shadow);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

[data-theme="tech"] .floating-legend-toggle {
    background: var(--bg-solid-light);
    border-color: var(--border-glass);
    box-shadow: var(--glass-shadow);
}

[data-theme="tech"] .floating-legend-toggle:hover {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4), var(--glass-shadow);
    border-color: var(--accent-color);
    background: var(--bg-solid-lighter);
}

[data-theme="tech"] .legend-chip {
    background: rgba(25, 25, 25, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: var(--tech-glow);
}

[data-theme="tech"] .legend-chip:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

[data-theme="tech"] .legend-chip.active {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
    /* 锁定状态的样式增强 */
    border-width: 2px;
    font-weight: bold;
}

body:not([data-theme]) .floating-legend-toggle,
[data-theme="light"] .floating-legend-toggle {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    color: rgba(60, 60, 60, 0.9);
}

body:not([data-theme]) .floating-legend-toggle:hover,
[data-theme="light"] .floating-legend-toggle:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--accent-color);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.2);
    color: var(--accent-color);
}

body:not([data-theme]) .legend-chip,
[data-theme="light"] .legend-chip {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body:not([data-theme]) .legend-chip:hover,
[data-theme="light"] .legend-chip:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

body:not([data-theme]) .legend-chip.active,
[data-theme="light"] .legend-chip.active {
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
    /* 锁定状态的样式增强 */
    border-width: 2px;
    font-weight: bold;
}

[data-theme="tech"] .floating-stats {
    background: rgba(25, 25, 25, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: var(--tech-glow);
}

[data-theme="tech"] .floating-input-panel {
    background: rgba(25, 25, 25, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: var(--tech-glow);
}

[data-theme="tech"] .panel-toggle-btn {
    background: var(--bg-solid);
    border-color: var(--tech-border);
    box-shadow: var(--tech-glow);
}

[data-theme="tech"] .panel-toggle-btn:hover {
    background: var(--bg-solid-lighter);
    border-color: var(--accent-color);
}

.visualization-container {
    flex: 1;
    position: relative;
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    min-height: calc(100vh - 70px);
    width: 100%;
    height: 100%;
}

#graphContainer {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 70px);
    background: transparent;
}

/* 状态样式 */
.loading-state,
.empty-state,
.error-state {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state .empty-icon,
.error-state .error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3,
.error-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

[data-theme="dark"] .empty-state p,
[data-theme="tech"] .empty-state p,
[data-theme="dark"] .error-state p,
[data-theme="tech"] .error-state p {
    color: var(--text-primary);
}

.empty-state p,
.error-state p {
    color: var(--text-secondary);
    text-align: center;
    max-width: 300px;
}

.error-state .error-icon {
    color: var(--danger-color);
}

.hidden {
    display: none !important;
}

/* 节点详情面板 - 右侧显示，避免与悬浮按钮重叠 */
.node-details {
    position: absolute;
    top: 1rem;
    right: calc(var(--button-size) + var(--button-gap) + 1.5rem);
    width: 350px;
    max-width: calc(100vw - var(--button-size) - var(--button-gap) - 3rem);
    max-height: 80%;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    z-index: 30;
    overflow: hidden;
}

[data-theme="tech"] .node-details {
    background: var(--bg-solid);
    border-color: var(--border-glass);
    box-shadow: var(--glass-shadow);
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-secondary);
}

[data-theme="tech"] .details-header {
    background: var(--bg-solid-light);
    border-bottom-color: var(--tech-border);
}

.details-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--text-primary);
}

.details-content {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

/* 统计信息栏 - 玻璃态悬浮 */
/* 悬浮图例组件 - 新设计 */
.floating-legend {
    position: absolute;
    top: 1rem;
    left: calc(400px + 1rem);
    right: calc(var(--button-size) + var(--button-gap) + 1rem);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    z-index: 18;
    pointer-events: none; /* 让容器本身不阻挡事件 */
}

.floating-legend > * {
    pointer-events: auto; /* 恢复子元素的事件 */
}

.floating-legend-toggle {
    width: var(--button-size);
    height: var(--button-size);
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glass-shadow);
    flex-shrink: 0;
}

.floating-legend-toggle:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.5);
    border-color: var(--accent-color);
}

.legend-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
    max-width: calc(100vw - 500px);
    transition: all 0.3s ease;
}

.floating-legend.collapsed .legend-grid {
    display: none;
}

.legend-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--glass-shadow);
    white-space: nowrap;
    min-height: 32px;
    /* 添加指针样式，表明可点击 */
    cursor: pointer;
}

.legend-chip:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
}

.legend-chip.active {
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
    /* 锁定状态的样式增强 */
    border-width: 2px;
    font-weight: bold;
}

.legend-chip-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
    line-height: 1;
}

.legend-chip-text {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.warning-color {
    background: linear-gradient(135deg, #fff2f0, #ffd6d6) !important;
    border: 1px solid #ff4d4f !important;
    box-shadow: 0 1px 4px rgba(255, 77, 79, 0.3) !important;
}

.high-cost-color {
    background: linear-gradient(135deg, #fff7e6, #ffd666) !important;
    border: 1px solid #fa8c16 !important;
    box-shadow: 0 1px 4px rgba(250, 140, 22, 0.3) !important;
}

/* 悬浮统计信息 */
.floating-stats {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    gap: 1rem;
    box-shadow: var(--glass-shadow);
    z-index: 15;
    opacity: 0.95;
    transition: all 0.3s ease;
    max-width: calc(100% - 2rem);
    overflow-x: auto;
}

.floating-stats:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.floating-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-width: 70px;
    flex-shrink: 0;
}

.floating-stats .stat-item span:first-child {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.8;
    white-space: nowrap;
}

.floating-stats .stat-item span:last-child {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

[data-theme="tech"] .modal-content {
    background: var(--bg-solid);
    border-color: var(--tech-border);
    box-shadow: var(--tech-glow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
}

[data-theme="tech"] .modal-header {
    border-bottom-color: var(--tech-border);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.example-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.tab-btn:hover:not(.active) {
    border-color: var(--accent-color);
}

#exampleContent {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
}

[data-theme="tech"] #exampleContent {
    background: var(--bg-solid-dark);
    border: 1px solid var(--tech-border);
    box-shadow: var(--tech-glow);
    font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-glass);
}

[data-theme="tech"] .modal-footer {
    border-top-color: var(--tech-border);
}

.modal-footer button {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.modal-footer button:last-child {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--accent-color);
}

[data-theme="tech"] .modal-footer button:last-child {
    color: white;
}

[data-theme="tech"] .modal-footer button {
    background: var(--bg-solid-light);
    border-color: var(--border-glass);
    box-shadow: var(--glass-shadow);
}

[data-theme="tech"] .modal-footer button:hover {
    background: var(--bg-solid-lighter);
    border-color: var(--accent-color);
    box-shadow: var(--glass-shadow);
}

.modal-footer button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* 响应式设计 - 玻璃态适配 */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .floating-input-panel {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        max-width: none;
        margin-bottom: 1rem;
        max-height: 50vh;
    }
    
    .floating-legend {
        position: relative;
        left: 0;
        top: 0;
        right: auto;
        margin-bottom: 1rem;
        flex-wrap: wrap;
    }
    
    .legend-grid {
        max-width: 100%;
    }
    
    .visualization-section {
        min-height: calc(100vh - 400px);
    }
    
    .node-details {
        right: 1rem;
        left: auto;
        width: 320px;
        max-width: calc(100vw - 2rem);
    }
    
    .visualization-container {
        min-height: calc(100vh - 400px);
    }
    
    #graphContainer {
        min-height: calc(100vh - 400px);
    }
}

@media (max-width: 768px) {
    :root {
        --button-size: 44px;
        --button-gap: 10px;
    }
    
    .app-header {
        padding: 0.75rem 1rem;
    }
    
    .app-header h1 {
        font-size: 1.1rem;
    }
    
    .main-content {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .floating-input-panel {
        position: fixed;
        top: 80px;
        left: 0.5rem;
        right: calc(var(--button-size) + 1.5rem);
        width: auto;
        max-width: none;
        padding: 0.75rem;
        max-height: 40vh;
        z-index: 25;
    }
    
    .floating-input-panel.collapsed {
        right: 0.5rem;
        width: auto;
        min-width: 140px;
        padding: 0.5rem 0.75rem;
    }
    
    .floating-input-panel.collapsed .input-header {
        margin-bottom: 0;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .floating-input-panel.collapsed .input-header h2 {
        font-size: 0.9rem;
        text-align: center;
    }
    
    .format-display-row {
        flex-direction: column;
        gap: 0.4rem;
        margin-bottom: 0.5rem;
    }
    
    .format-selector-container {
        max-width: 100%;
        order: 1;
        flex: 1;
    }
    
    .format-display-container {
        order: 2;
        flex: none;
        width: 100%;
    }
    
    .format-selector {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
        padding-right: 1.8rem;
        background-size: 0.8rem;
    }
    
    .format-display {
        font-size: 0.7rem;
        padding: 0.4rem 2rem 0.4rem 0.6rem;
    }
    
    .copy-btn-inner {
        width: 24px;
        height: 24px;
        right: 3px;
    }
    
    .copy-icon {
        font-size: 0.65rem;
    }
    
    .quick-actions {
        justify-content: center;
        gap: 0.3rem;
        margin-bottom: 0.5rem;
    }
    
    .action-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
        gap: 0.2rem;
        min-width: auto;
    }
    
    .action-btn span:first-child {
        font-size: 0.7rem;
    }
    
    .visualization-section {
        padding: 0;
        min-height: calc(100vh - 350px);
    }
    
    .floating-controls {
        top: 0.75rem;
        right: 0.75rem;
    }
    
    /* 当输入面板展开时，调整按钮位置避免重叠 */
    .floating-input-panel:not(.collapsed) ~ .floating-controls {
        top: calc(40vh + 90px);
    }
    
    .floating-legend {
        position: fixed;
        top: calc(40vh + 100px);
        left: 0.5rem;
        right: calc(var(--button-size) + 1.5rem);
        z-index: 17;
        gap: 0.5rem;
    }
    
    .floating-legend-toggle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .legend-grid {
        max-width: calc(100vw - 120px);
    }
    
    .legend-chip {
        padding: 0.25rem 0.5rem;
        min-height: 28px;
        font-size: 0.7rem;
    }
    
    .legend-chip-text {
        max-width: 60px;
    }
    
    .floating-btn::after {
        display: none; /* 隐藏移动端工具提示 */
    }
    
    .floating-stats {
        bottom: 0.5rem;
        right: 0.5rem;
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
        border-radius: 10px;
        max-width: calc(100% - 1rem);
    }
    
    .floating-stats .stat-item {
        min-width: 50px;
    }
    
    .floating-stats .stat-item span:first-child {
        font-size: 0.65rem;
    }
    
    .floating-stats .stat-item span:last-child {
        font-size: 0.8rem;
    }
    
    .node-details {
        width: calc(100% - 1rem);
        right: 0.5rem;
        left: auto;
        top: calc(40vh + 90px + 1rem);
        max-height: 50vh;
    }
    
    /* 当输入面板收起时，节点详情可以上移 */
    .floating-input-panel.collapsed ~ .floating-controls ~ .node-details,
    .floating-input-panel.collapsed ~ .node-details {
        top: 1rem !important;
        max-height: 60vh;
    }
    
    .floating-legend.collapsed ~ .node-details {
        top: calc(1rem + 50px);
    }
}

/* 极小屏幕适配 */
@media (max-width: 480px) {
    .floating-input-panel {
        padding: 0.5rem;
        max-height: 35vh;
    }
    
    .floating-input-panel:not(.collapsed) {
        right: calc(var(--button-size) + 1rem);
    }
    
    .floating-input-panel.collapsed {
        min-width: 100px;
        padding: 0.4rem 0.6rem;
    }
    
    .floating-input-panel.collapsed .input-header h2 {
        font-size: 0.8rem;
    }
    
    .panel-toggle-btn {
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }
    
    .format-tabs {
        gap: 0.2rem;
        margin-bottom: 0.4rem;
    }
    
    .format-tab {
        padding: 0.25rem 0.4rem;
        font-size: 0.65rem;
        gap: 0.1rem;
        border-radius: 6px;
    }
    
    .format-tab .tab-icon {
        font-size: 0.7rem;
    }
    
    .quick-actions {
        gap: 0.2rem;
        margin-bottom: 0.4rem;
    }
    
    .action-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.65rem;
        gap: 0.1rem;
        border-radius: 4px;
    }
    
    .action-btn span:first-child {
        font-size: 0.65rem;
    }
    
    .floating-controls {
        gap: 8px;
    }
    
    .floating-input-panel:not(.collapsed) ~ .floating-controls {
        top: calc(35vh + 85px);
    }
    
    .node-details {
        width: calc(100% - 1rem);
        right: 0.5rem;
        left: auto;
        top: calc(35vh + 85px + var(--button-size) * 5 + var(--button-gap) * 4 + 1rem);
        max-height: 40vh;
    }
    
    /* 当输入面板收起时，节点详情可以上移 */
    .floating-input-panel.collapsed ~ .floating-controls ~ .node-details,
    .floating-input-panel.collapsed ~ .node-details {
        top: calc(var(--button-size) + var(--button-gap) + 1rem) !important;
        max-height: 50vh;
    }
    
    .floating-legend {
        top: calc(35vh + 85px);
        gap: 0.4rem;
    }
    
    .floating-legend-toggle {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .legend-grid {
        max-width: calc(100vw - 100px);
    }
    
    .legend-chip {
        padding: 0.2rem 0.4rem;
        min-height: 24px;
        font-size: 0.65rem;
        gap: 0.3rem;
    }
    
    .legend-chip-icon {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
    
    .legend-chip-text {
        max-width: 50px;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    #explainInput {
        min-height: 150px;
        font-size: 0.75rem;
    }
}

/* 全屏背景动画系统 - 仅在科技主题下显示 */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
    display: none; /* 默认隐藏 */
}

/* 仅在科技主题下显示背景动画 */
[data-theme="tech"] .animated-background {
    display: block;
}

.floating-square {
    position: absolute;
    background: var(--accent-color);
    border-radius: 4px;
    opacity: 0.1;
    transition: opacity 0.3s ease;
}

/* 不同大小和初始位置的方框 */
.square-1 {
    width: 20px;
    height: 20px;
    top: 20%;
    left: 10%;
    animation: floatSquare1 15s ease-in-out infinite;
}

.square-2 {
    width: 15px;
    height: 15px;
    top: 60%;
    left: 80%;
    animation: floatSquare2 18s ease-in-out infinite;
}

.square-3 {
    width: 25px;
    height: 25px;
    top: 40%;
    left: 50%;
    animation: floatSquare3 20s ease-in-out infinite;
}

.square-4 {
    width: 12px;
    height: 12px;
    top: 80%;
    left: 30%;
    animation: floatSquare4 22s ease-in-out infinite;
}

.square-5 {
    width: 18px;
    height: 18px;
    top: 10%;
    left: 70%;
    animation: floatSquare5 16s ease-in-out infinite;
}

.square-6 {
    width: 22px;
    height: 22px;
    top: 70%;
    left: 15%;
    animation: floatSquare6 19s ease-in-out infinite;
}

.square-7 {
    width: 14px;
    height: 14px;
    top: 30%;
    left: 85%;
    animation: floatSquare7 21s ease-in-out infinite;
}

.square-8 {
    width: 16px;
    height: 16px;
    top: 90%;
    left: 60%;
    animation: floatSquare8 17s ease-in-out infinite;
}

/* 仅科技主题下的方框样式 */
[data-theme="tech"] .floating-square {
    background: var(--accent-color);
    opacity: 0.15;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

/* 方框动画关键帧 - 确保在视口范围内移动 */
@keyframes floatSquare1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30vw, -10vh) rotate(90deg); }
    50% { transform: translate(60vw, 15vh) rotate(180deg); }
    75% { transform: translate(20vw, 25vh) rotate(270deg); }
}

@keyframes floatSquare2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(-40vw, 10vh) rotate(45deg); }
    40% { transform: translate(-20vw, -20vh) rotate(135deg); }
    60% { transform: translate(-60vw, -10vh) rotate(225deg); }
    80% { transform: translate(-30vw, 5vh) rotate(315deg); }
}

@keyframes floatSquare3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    30% { transform: translate(20vw, 20vh) rotate(60deg); }
    60% { transform: translate(-25vw, 10vh) rotate(180deg); }
    90% { transform: translate(10vw, -15vh) rotate(300deg); }
}

@keyframes floatSquare4 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(40vw, -15vh) rotate(72deg); }
    50% { transform: translate(10vw, -25vh) rotate(144deg); }
    75% { transform: translate(-20vw, -10vh) rotate(216deg); }
}

@keyframes floatSquare5 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(15vw, 25vh) rotate(120deg); }
    66% { transform: translate(-30vw, 20vh) rotate(240deg); }
}

@keyframes floatSquare6 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(50vw, 10vh) rotate(36deg); }
    40% { transform: translate(30vw, -15vh) rotate(108deg); }
    60% { transform: translate(60vw, -5vh) rotate(216deg); }
    80% { transform: translate(45vw, 15vh) rotate(324deg); }
}

@keyframes floatSquare7 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-50vw, 15vh) rotate(90deg); }
    50% { transform: translate(-30vw, -20vh) rotate(180deg); }
    75% { transform: translate(-60vw, 5vh) rotate(270deg); }
}

@keyframes floatSquare8 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    30% { transform: translate(20vw, -20vh) rotate(108deg); }
    60% { transform: translate(-10vw, -30vh) rotate(216deg); }
    90% { transform: translate(35vw, -15vh) rotate(324deg); }
}

/* 方案1: 完全移除position relative，使用更简单的层级控制 */
.floating-input-panel,
.floating-stats,
.node-details,
.modal-content {
    /* 移除position relative，避免创建新的堆叠上下文 */
    z-index: 20;
}

/* 堆叠上下文问题已通过移除不必要的position: relative解决 */

/* 科技主题悬浮统计信息设置已合并到上方 */

/* 科技感主题优化动画效果 */

[data-theme="tech"] .floating-input-panel::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(45deg, var(--accent-color), transparent, var(--accent-color), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: subtract;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
    animation: techBorderFloat 4s linear infinite;
    opacity: 0.4;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

@keyframes techBorderFloat {
    0% { 
        transform: rotate(0deg) translate(0px, 0px); 
    }
    25% { 
        transform: rotate(90deg) translate(2px, -1px); 
    }
    50% { 
        transform: rotate(180deg) translate(-1px, 2px); 
    }
    75% { 
        transform: rotate(270deg) translate(-2px, -1px); 
    }
    100% { 
        transform: rotate(360deg) translate(0px, 0px); 
    }
}

[data-theme="tech"] .app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    animation: techScanFloat 3s ease-in-out infinite;
}

@keyframes techScanFloat {
    0%, 100% { 
        opacity: 0.2; 
        transform: scaleX(0.3) translateY(0px); 
    }
    25% { 
        opacity: 0.6; 
        transform: scaleX(0.7) translateY(-0.5px); 
    }
    50% { 
        opacity: 1; 
        transform: scaleX(1) translateY(0.5px); 
    }
    75% { 
        opacity: 0.6; 
        transform: scaleX(0.7) translateY(-0.5px); 
    }
}

/* 悬浮按钮微动画 - 移除可能导致滚动条的动画 */
[data-theme="tech"] .floating-btn {
    /* 使用更温和的动画效果，避免位移 */
    animation: techButtonGlow 4s ease-in-out infinite;
}

[data-theme="tech"] .floating-btn:nth-child(1) {
    animation-delay: 0s;
}

[data-theme="tech"] .floating-btn:nth-child(2) {
    animation-delay: 0.5s;
}

[data-theme="tech"] .floating-btn:nth-child(3) {
    animation-delay: 1s;
}

[data-theme="tech"] .floating-btn:nth-child(4) {
    animation-delay: 1.5s;
}

[data-theme="tech"] .floating-btn:nth-child(5) {
    animation-delay: 2s;
}

/* 新的发光动画，不会导致位移 */
@keyframes techButtonGlow {
    0%, 100% { 
        box-shadow: var(--glass-shadow);
        border-color: var(--border-glass);
    }
    50% { 
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.4), var(--glass-shadow);
        border-color: rgba(0, 212, 255, 0.6);
    }
}

/* 移除导致滚动条的按钮浮动动画 */

/* 科技感加载动画 */
[data-theme="tech"] .loading-spinner {
    border-color: var(--border-glass);
    border-top-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    animation: spin 1s linear infinite, techSpinnerFloat 3s ease-in-out infinite;
}

@keyframes techSpinnerFloat {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) rotate(0deg); 
    }
    25% { 
        transform: translateY(-2px) translateX(1px) rotate(90deg); 
    }
    50% { 
        transform: translateY(0px) translateX(2px) rotate(180deg); 
    }
    75% { 
        transform: translateY(2px) translateX(-1px) rotate(270deg); 
    }
}

/* SQL示例和优化建议样式 */
.sql-example-item {
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
    background: var(--bg-secondary);
}

.sql-example-header {
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-glass);
}

.sql-example-header h5 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.sql-code-block {
    padding: 0.75rem;
    background: var(--bg-secondary);
    overflow-x: auto;
}

.sql-code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.copy-sql-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.copy-sql-btn:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-1px);
}

/* SQL示例主题配色变量 */
:root {
    --sql-item-bg: rgba(255, 255, 255, 0.8);
    --sql-item-border: rgba(255, 255, 255, 0.6);
    --sql-item-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    --sql-header-bg: rgba(255, 255, 255, 0.7);
    --sql-header-border: rgba(255, 255, 255, 0.5);
    --sql-code-bg: rgba(255, 255, 255, 0.6);
    --sql-btn-bg: rgba(255, 255, 255, 0.8);
    --sql-btn-border: rgba(255, 255, 255, 0.6);
    --sql-btn-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    --sql-btn-hover-bg: rgba(255, 255, 255, 0.95);
    --sql-btn-hover-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] {
    --sql-item-bg: rgba(0, 0, 0, 0.2);
    --sql-item-border: rgba(255, 255, 255, 0.1);
    --sql-item-shadow: var(--glass-shadow);
    --sql-header-bg: rgba(0, 0, 0, 0.25);
    --sql-header-border: rgba(255, 255, 255, 0.1);
    --sql-code-bg: rgba(0, 0, 0, 0.2);
    --sql-btn-bg: rgba(0, 0, 0, 0.3);
    --sql-btn-border: rgba(255, 255, 255, 0.1);
    --sql-btn-shadow: var(--glass-shadow);
    --sql-btn-hover-bg: rgba(0, 0, 0, 0.4);
    --sql-btn-hover-shadow: var(--glass-shadow);
}

[data-theme="tech"] {
    --sql-item-bg: var(--bg-solid);
    --sql-item-border: var(--tech-border);
    --sql-item-shadow: var(--tech-glow);
    --sql-header-bg: var(--bg-solid-light);
    --sql-header-border: var(--tech-border);
    --sql-code-bg: var(--bg-solid-dark);
    --sql-btn-bg: var(--bg-solid-light);
    --sql-btn-border: var(--tech-border);
    --sql-btn-shadow: var(--glass-shadow);
    --sql-btn-hover-bg: var(--bg-solid-lighter);
    --sql-btn-hover-shadow: var(--tech-glow);
}

/* SQL示例统一样式 - 使用主题变量 */
.sql-example-item {
    background: var(--sql-item-bg);
    border: 1px solid var(--sql-item-border);
    box-shadow: var(--sql-item-shadow);
}

.sql-example-header {
    background: var(--sql-header-bg);
    border-bottom: 1px solid var(--sql-header-border);
}

.sql-code-block {
    background: var(--sql-code-bg);
}

.copy-sql-btn {
    background: var(--sql-btn-bg);
    border: 1px solid var(--sql-btn-border);
    box-shadow: var(--sql-btn-shadow);
}

.copy-sql-btn:hover {
    background: var(--sql-btn-hover-bg);
    border-color: var(--accent-color);
    box-shadow: var(--sql-btn-hover-shadow);
}

/* 科技主题特殊字体 */
[data-theme="tech"] .sql-code-block {
    font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}



/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

[data-theme="tech"] ::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    box-shadow: var(--glass-shadow);
}

[data-theme="tech"] ::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}